package com.wlz.basic.hashcodeEquals;


import java.util.Objects;

/**
 * @author wlz
 * @date 2022-08-01  8:16 下午
 */
public class User {

    private String name;

    public User(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
       User user = (User) o;
        return user.getName().equals(this.name);
    }

    @Override
    public int hashCode() {
        return name.hashCode();
    }
}
